#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 7;
int a1[N], c[N], d[N][N], x[N], a[N];
int main() {
    freopen("arena.in", "r", stdin);
    freopen("arena.out", "w", stdout);
    int n, m;
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; ++i) scanf("%d", a1 + i);
    for (int j = 1; j <= m; ++j) scanf("%d", c + j);
    int k = log2(n);
    if (pow(2, k) < n) ++k;
    for (int i = 1; i <= n; ++i) {
        int r = pow(2, k-i);
        for (int j = 1; j <= r; ++j)
            scanf("%1d", d[i] + j);
    }
    int T;
    scanf("%d", &T);
    while (T--) {
        for (int i = 0; i < 4; ++i) scanf("%d", x + i);
        for (int i = 1; i <= n; ++i) a[i] = a1[i] ^ x[i%4];
        for (int i = 1; i <= n; ++i) {
            int r = pow(2, k - i);
            for (int j = 1; j <= r; ++j) {

            }
        }
    }
}
